Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of stormwater and wastewater capabilities in WNTR #437

Open
wants to merge 77 commits into
base: main
Choose a base branch
from

Conversation

kaklise
Copy link
Collaborator

@kaklise kaklise commented Jul 22, 2024

Summary

The following PR includes preliminary capabilities to analyze stormwater and wastewater systems in WNTR. This capability resides in the stormwater subpackage and is referred to as S-WNTR since it is intended to be used as a standalone package. A subset of WNTR classes/methods/functions are imported into the stormwater subpackage to avoid duplicating code where possible.

The capabilities leverage SWMM, pyswmm, and swmmio within a framework that facilitates the use of WNTR for resilience analysis of stormwater and wastewater systems. This update includes SWMM, pyswmm, and swmmio as optional dependencies of WNTR.

Note that unlike WNTR for drinking water systems, S-WNTR does not convert models to SI units. The SWMM INP file units are retained.

Basic usage
The user can import wntr.stormwater as swntr and then load a SWMM INP file into a StormWaterNetworkModel object using swn = swntr.network.StormWaterNetworkModel(inp_filename). The model is stored as a collection of Pandas DataFrames, which can be modified to change model properties and create scenarios for resilience analysis.

Simulations are run using sim = swntr.sim.SWMMSimulator(swn) followed by results = sim.run_sim(). Simulation results are stored in pandas DataFrames for node, link, and subcatchment attributes.

Additional capabilities

  • Read/write SWMM INP files
  • Read SWMM RPT and OUT files
  • Convert the model to a NetworkX graph
  • Convert the model to GeoPandas GeoDataFrames
  • Save the model in GeoJSON file format
  • Add pump outage controls to the model
  • Add composite patterns to the model, to include multiple DWF per junction
  • Add/modify timeseries and patterns in the model using datetime indexed DataFrames
  • Identify upstream and downstream nodes and edges
  • Compute travel time using a steady state flowrate
  • Compute the time to reach capacity using a steady state flowrate
  • Compute pump power and energy use
  • Plot basic network graphics with node and link attributes

For more information, see stormwater.rst

Tests and documentation

Tests have been included in test_stormwater.py and documentation in stormwater.rst

Acknowledgement

By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.

@kaklise kaklise requested a review from dbhart July 24, 2024 15:58
@coveralls
Copy link

coveralls commented Jul 24, 2024

Coverage Status

coverage: 84.045% (-0.2%) from 84.218%
when pulling 4c47a03 on kaklise:swntr
into 9a2a18f on USEPA:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants